package org.sundatagroup.aurora.core.entity.model;

import java.io.Serializable;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * <p>粒子在数据库的数据结构
 * </p>
 * 
 * @author Zdream
 * @date 2018-06-01
 * @since 0.2.0
 */
@Document(collection = "particle")
public final class ParticleModel implements Serializable {
	
	private static final long serialVersionUID = 464927455019228954L;
	
    @Id
    private int id;
    private String rule;
    private String data;
    private String desc;

	public ParticleModel() {
		
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getRule() {
		return rule;
	}

	public void setRule(String rule) {
		this.rule = rule;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ParticleModel other = (ParticleModel) obj;
		if (id != other.id)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ParticleModel [id=" + id + ", rule=" + rule + ", data=" + data + ", desc=" + desc + "]";
	}

}
